package com.wn.service.impl;

import com.wn.dao.SensitiveWordDao;
import com.wn.entity.SensitiveWord;
import com.wn.service.SensitiveWordService;
import com.wn.utils.sysmgr.SensitiveWordInit;
import com.wn.utils.sysmgr.SensitivewordEngine;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
import java.util.Set;

@Service("sensitiveWordService")
@Transactional(rollbackFor = Exception.class)
public class SensitiveWordServiceImpl implements SensitiveWordService {
    @Resource
    private SensitiveWordDao sensitiveWordDao;

    @SuppressWarnings("rawtypes")
    @Override
    public Set<String> sensitiveWordFiltering(String text)
    {
        // 得到敏感词有哪些，传入2表示获取所有敏感词
        Set<String> set = SensitivewordEngine.getSensitiveWord(text, 2);
        return set;
    }

}
